﻿open System
open System.Text
open System.Diagnostics
open SoftwarePackages.PackageSourceListModule

let sourcesDirectory = "PkgSources"
let list = new PackageList(sourcesDirectory, true)
let packages = list.Packages
if packages.Length > 0 then
    for package in packages do
        printfn "%s" package
        
        let versions = list.Versions(package)
        if versions.Length > 0 then
            for version in versions do
                let info = list.VersionInformation(version)
                printfn "\t%A" version
        else
            printfn "\tno versions found"
        
        printfn ""
else
    printfn "no packages found"

Dispose(list)

printfn ""

if Debugger.IsAttached then
    printf "debug stuff\npress any key to continue..."
    Console.ReadKey() |> ignore
